<?php
$Customer = Dracosys::getSessionValue(SESSION_INTERFACE, 'Customer');
?>

<h2>Editar Cliente</h2>
<section id="CustomerEdit">
    <form method="post" action="cliente/atualizar" name="FormEditarCliente">
        <?php if ($Customer->isPessoaJuridica()): ?>
            <section id="CustomerEdit_Enterprise">
                <div class="title">Dados da Empresa</div>
                <div class="out_txt big"><label for="CustomerEdit_StRazaoSocial">Razão Social</label></div>
                <div class="inp_txt big"><input type="text" name="StRazaoSocial" value="<?= $Customer->getArEnterpriseData('StRazaoSocial') ?>" id="CustomerEdit_StRazaoSocial" /></div>
                <div class="out_txt big"><label for="CustomerEdit_StNomeFantasia">Nome Fantasia</label></div>
                <div class="inp_txt big"><input type="text" name="StNomeFantasia" value="<?= $Customer->getArEnterpriseData('StNomeFantasia') ?>" id="CustomerEdit_StNomeFantasia" /></div>
                <div class="out_txt big"><label for="CustomerEdit_DtFundacao">Data de Fundação</label></div>
                <div class="inp_txt big"><input type="text" name="DtFundacao" value="<?= dateBDtoBR($Customer->getArEnterpriseData('DtFundacao')) ?>" id="CustomerEdit_DtFundacao" class="Date"/></div>
                <div class="out_txt big"><label for="CustomerEdit_StCnpj">Cnpj</label></div>
                <div class="inp_txt big"><input type="text" name="StCnpj" value="<?= $Customer->getArEnterpriseData('StCnpj') ?>" id="CustomerEdit_StCnpj" class="Vat"/></div>
                <div class="out_txt big"><label for="CustomerEdit_StCargo">Cargo</label></div>
                <div class="inp_txt big"><input type="text" name="StCargo" value="<?= $Customer->getArIndividualData('StCargo') ?>" id="CustomerEdit_StCargo" /></div>
            </section>
        <?php endif; ?>
        <section id="CustomerEdit_Individual">
            <div class="title">Dados Cliente/Representante</div>
            <div class="out_txt big"><label for="CustomerEdit_StNome">Nome</label></div>
            <div class="inp_txt big"><input type="text" name="StNome" value="<?= $Customer->getArIndividualData('StNome') ?>" id="CustomerEdit_StNome" /></div>
            <div class="out_txt big"><label for="CustomerEdit_StCpf">Cpf</label></div>
            <div class="inp_txt big"><input type="text" name="StCpf" value="<?= $Customer->getArIndividualData('StCpf') ?>" class="Cpf" id="CustomerEdit_StCpf" /></div>
            <div class="out_txt big"><label for="CustomerEdit_StRg">Rg</label></div>
            <div class="inp_txt big"><input type="text" name="StRg" value="<?= $Customer->getArIndividualData('StRg') ?>" id="CustomerEdit_StRg" /></div>
            <div class="out_txt big"><label for="CustomerEdit_DtNascimento">Nascimento</label></div>
            <div class="inp_txt big"><input type="text" name="DtNascimento" value="<?= dateBDtoBR($Customer->getArIndividualData('DtNascimento')) ?>" class="Date" id="CustomerEdit_DtNascimento" /></div>
        </section>
        <section id="CustomerEdit_General">
            <div class="title">Contato</div>
            <div class="out_txt big"><label for="CustomerEdit_StEmail">Email</lavel></div>
            <div class="inp_txt big"><input type="text" name="StEmail" value="<?= $Customer->getArGeneralData('StEmail') ?>" id="CustomerEdit_StEmail" /></div>
            <div class="out_txt big"><label for="CustomerEdit_StEndereco">Endereço</lavel></div>
            <div class="inp_txt big"><input type="text" name="StEndereco" value="<?= $Customer->getArGeneralData('StEndereco') ?>" id="CustomerEdit_StEndereco" /></div>
            <div class="out_txt big"><label for="CustomerEdit_StNumero">N&uacute;mero</lavel></div>
            <div class="inp_txt big"><input type="text" name="StNumero" value="<?= $Customer->getArGeneralData('StNumero') ?>" id="CustomerEdit_StNumero" /></div>
            <div class="out_txt big"><label for="CustomerEdit_StComplemento">Complemento</lavel></div>
            <div class="inp_txt big"><input type="text" name="StComplemento" value="<?= $Customer->getArGeneralData('StComplemento') ?>" id="CustomerEdit_StComplemento" /></div>
            <div class="out_txt big"><label for="CustomerEdit_StBairro">Bairro</lavel></div>
            <div class="inp_txt big"><input type="text" name="StBairro" value="<?= $Customer->getArGeneralData('StBairro') ?>" id="CustomerEdit_StBairro" /></div>
            <div class="out_txt big"><label for="CustomerEdit_StCidade">Cidade</lavel></div>
            <div class="inp_txt big"><input type="StCidade" name="StCidade" value="<?= $Customer->getArGeneralData('StCidade') ?>" id="CustomerEdit_StCidade" /></div>
            <div class="out_txt big"><label for="CustomerEdit_StEstado">Estado</lavel></div>
            <div class="inp_txt big"><input type="text" name="StEstado" value="<?= $Customer->getArGeneralData('StEstado') ?>" id="CustomerEdit_StEstado" /></div>
            <div class="out_txt big"><label for="CustomerEdit_StDddTelefone">DDD Telefone</lavel></div>
            <div class="inp_txt big"><input type="text" name="StDddTelefone" value="<?= $Customer->getArGeneralData('StDddTelefone') ?>" class="DddPhone" id="CustomerEdit_StDddTelefone" /></div>
            <div class="out_txt big"><label for="CustomerEdit_StTelefone">Telefone Residencial</lavel></div>
            <div class="inp_txt big"><input type="text" name="StTelefone" value="<?= $Customer->getArGeneralData('StTelefone') ?>" class="Phone" id="CustomerEdit_StTelefone" /></div>
            <div class="out_txt big"><label for="CustomerEdit_StDddCelular">DDD Celular</lavel></div>
            <div class="inp_txt big"><input type="text" name="StDddCelular" value="<?= $Customer->getArGeneralData('StDddCelular') ?>" class="DddPhone" id="CustomerEdit_StDddCelular" /></div>
            <div class="out_txt big"><label for="CustomerEdit_StCelular">Telefone Celular</lavel></div>
            <div class="inp_txt big"><input type="text" name="StCelular" value="<?= $Customer->getArGeneralData('StCelular') ?>" class="Phone" id="CustomerEdit_StCelular" /></div>
        </section>
        <section id="CustomerEdit_Financial">
            <div class="title">Financeiro</div>
            <div class="out_txt big"><label for="CustomerEdit_ItDesconto">Desconto</lavel></div>
            <div class="inp_txt big"><input type="text" name="ItDesconto" value="<?= $Customer->getFinanceiro()->getItDesconto() ?>" id="CustomerEdit_ItDesconto" /></div>
            <div class="out_txt big"><label for="CustomerEdit_EnTipoPagamento">Tipo de Pagamento</lavel></div>
            <div class="inp_txt big">
                <select name="EnTipoPagamento" id="CustomerEdit_EnTipoPagamento">
                    <option value="CARTAO" <?= $Customer->getFinanceiro()->isCreditCard() ? 'selected="selected"' : '' ?>>Cartão</option>
                    <option value="BOLETO" <?= $Customer->getFinanceiro()->isBillet() ? 'selected="selected"' : '' ?>>Boleto</option>
                </select>
            </div>
             <div class="out_txt big"><label for="CustomerEdit_EnTipoPagamento">Tipo de Pagamento</lavel></div>
             <div class="inp_txt big">
                <select name="EnPeriodicidade" id="CustomerEdit_EnPeriodicidade">
                    <option value="ANUAL" <?= $Customer->getFinanceiro()->isYearly() ? 'selected="selected"' : '' ?>>Anual</option>
                    <option value="MENSAL"<?= $Customer->getFinanceiro()->isMonthly() ? 'selected="selected"' : '' ?>>Mensal</option>
                </select>
            </div>
           <div class="btn"><button class="v1">Atualizar</button></div>
        </section>
        <input type="hidden" name="IDCliente" value="<?= treatUrl('id')?>" id="CustomerEdit_IDCliente" />
    </form>
</section>
